<?php
class Projet {
    private $nom;
    private $debut;
    private $fin;
    private $prixFactureMO;
    private $mission;
   
    public function __construct($nom, $debut, $fin, $prixFactureMO){
     $this->nom=$nom;
     $this->debut=$debut;
     $this->fin=$fin;
     $this->prixFactureMO=$prixFactureMO;
     $this->missions=array();
    }
    
    public function ajoutMission($uneMission) {
        $this->mission[]=$uneMission;
    }
    
    public function cumulCoutMO() {
        $cumul=0;
        foreach ($this->missions as $uneMission) {
        $taux=$uneMission->getExcecutant()->getTauxHoraire();
        $cumul=$cumul+$taux*$uneMission->nbHeuresEffectuees();
        }
        return cumulCoutMO;
    }
    
    public function margeBruteCourante() {
        return $this->prixFactureMO-$this->cumulCoutMO();
    }
}

?>